package com.ice.work.moment.facade.user.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.honeybee.cloud.framework.common.page.Page;
import com.ice.work.moment.facade.user.dto.UserDTO;
import com.ice.work.moment.facade.user.model.User;
import com.ice.work.moment.facade.user.vo.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.Collection;
import java.util.List;

/**
 * @Description UserMapper
 * @Author DELL
 * @Create 2019-01-09
 * @Since 1.0.0
 */
@Mapper
@SuppressWarnings("all")
public interface UserConvertMapper {
    UserConvertMapper INSTANCE = Mappers.getMapper(UserConvertMapper.class);

    /**
     * User 转 UserDTO
     *
     * @param from
     * @return
     */
    UserDTO toDTO(User from);

    /**
     * Collection<User> 转List<UserDTO>
     *
     * @param from
     * @return
     */
    List<UserDTO> toDTO(Collection<User> from);

    /**
     * UserDTO 转 UserVO
     *
     * @param to
     * @return
     */
    UserVO toVO(UserDTO to);

    /**
     * Collection<UserDTO> 转List<UserVO>
     *
     * @param from
     * @return
     */
    List<UserVO> toVO(Collection<UserDTO> from);

    /**
     * IPage<UserDTO> to Page<UserVO>
     *
     * @param from
     * @return
     */
    Page<UserVO> toVO(Page<UserDTO> from);

    /**
     * toUserDTO
     * @param from
     * @return
     */
    Page<UserDTO> toDTO(IPage<User> from);
}
